package lc.com.architecture.base;

import android.app.Application;

import lc.com.architecture.dagger.component.AppComponent;
import lc.com.architecture.dagger.component.DaggerAppComponent;
import lc.com.architecture.dagger.module.AppModule;
import lc.com.architecture.dagger.module.HttpClientModule;

/**
 * @author LiuChao
 * @describe
 * @date 2017/11/3
 * @contact email:450127106@qq.com
 */

public class BaseApplication extends Application {

    public static AppComponent appComponent;

    @Override
    public void onCreate() {
        super.onCreate();
        initAppComponent();
    }

    public static AppComponent getAppComponent() {
        return appComponent;
    }

    private void initAppComponent() {
        appComponent = DaggerAppComponent.builder()
                .appModule(new AppModule(this))
                .httpClientModule(new HttpClientModule("www.baidu.com"))
                .build();
    }
}
